$(function() {
	var initData = $("#initData").val();
	var ss = initData.split(",");
	initLoad();
});

function initLoad() {
	var cols = ['ID','名称', '链接', '排序', '父级', '图标'];
	var models = [{
        name: 'id',
        index: 'id',
        width: 200,
        fixed: true,
        key: true,
        search: false,
        editable: false,
        editoptions: {
            readonly: true
        }
    },{
		name: 'resName',
		index: 'resName',
		editable: true,
		editrules: {edithidden:true,required:true},
		searchoptions: {
            'sopt': ['cn']
        }
	},
	{
		name: 'resUrl',
		index: 'resUrl',
		searchoptions: {
            'sopt': ['cn']
        },
		editable: true,
		editrules: {edithidden:true,required:true}
	},
	{
		name: 'resSort',
		index: 'resSort',
		search: false,
		editable: true,
		editrules: {edithidden:true,required:true,number:true,minValue:1,maxValue:10000}
	},
	{
		name: 'resPid',
		index: 'resPid',
		search: false,
		editable: false
	},
	{
		name: 'resIcon',
		index: 'resIcon',
		search: false,
		editable: true,
		formatter: function(cv, op, rb) {
			return '<i class="' + cv + '" ></i>';
		}
	}];
    var datas = {
        "sortorder": "ASC",
        "sortname":"resSort"
    };
	loadData("/master/ress", "tabdiv", datas, cols, models);
}
